extends Button
# 信号的定义
signal signalTest(param1: float)

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	connect("pressed", Callable(self, "Mypressed")) # 连接信号（绑定信号）
	signalTest.connect(Callable(self, "doSignalfunc"))# 连接信号（绑定信号）
	#上面是默认的绑定，或者叫动态绑定，在编辑器中也可以进行实例的绑定
	pass # Replace with function body.


func _process(_delta: float) -> void:
	if Input.is_key_pressed(KEY_Q):
		signalTest.emit(1.0)# 信号发射
		emit_signal("signalTest", 1.0)# 信号发射
	pass

func Mypressed() -> void:
	var aicon = get_node("/root/Node2D/Sprite2D")
	aicon.queue_free()
	pass

func doSignalfunc(time: float) -> void:
	print("doSignalfunc", time)
	pass
